package pl.com.qapps.unity;

import java.io.IOException;
import java.util.concurrent.TimeUnit;

/**
 * @author Jakub Dykowski
 * 
 */
public class UnityTest {
	public static void main(String[] args) throws IllegalStateException,
			IOException, InterruptedException {
		try {
			System.out.printf("Unity is supported: %s\n", Unity.isSupported());
			AppLauncher firefox = AppLauncher
					.getForDesktopFile("firefox.desktop");
			System.out.println(firefox);
			firefox.setUrgent(true);
			firefox.setCountVisible(true);
			firefox.setCount(3);
			TimeUnit.SECONDS.sleep(1);
			firefox.setUrgent(false);
			firefox.setProgressVisible(true);
			firefox.setProgress(0.5);
			TimeUnit.SECONDS.sleep(2);
			firefox.setCount(0);
		} catch (LauncherException e) {
			System.err.println("is implementation Error: "
					+ e.isImplementationError());
			e.printStackTrace(System.err);
		}
		System.out.println("done!");
	}
}
